package org.gruposp2p.dnie.client.ui.panel;

import org.gruposp2p.dnie.client.ui.widget.dynatable.MostSignedDocumentsWidget;
import org.gruposp2p.dnie.client.ui.widget.dynatable.SearchDocumentsWidget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class SearchPanel extends Composite {

	private static SearchPanelUiBinder uiBinder = GWT
			.create(SearchPanelUiBinder.class);

	interface SearchPanelUiBinder extends UiBinder<Widget, SearchPanel> {}

	public static SearchPanel INSTANCE;
    @UiField VerticalPanel contentPanel;
	SearchDocumentsWidget searchDocuments;
	
	public SearchPanel() {
		initWidget(uiBinder.createAndBindUi(this));
		INSTANCE = this;
	}
	
	public void setSearchResult (String searchText) {
		
	}

    public SearchPanel getInstance () {
        if (searchDocuments == null) {
        	searchDocuments = new SearchDocumentsWidget(10);
            contentPanel.add(searchDocuments);
        }
        return this;
    }
	
}
